package com.predic8.membrane.servlet.embedded;

import com.predic8.membrane.annot.MCAttribute;
import com.predic8.membrane.annot.MCElement;
import com.predic8.membrane.annot.MCMain;
import com.predic8.membrane.core.transport.Transport;
import com.predic8.membrane.core.transport.ssl.SSLProvider;

import java.io.IOException;

@MCMain(
        outputPackage="com.predic8.membrane.core.config.spring",
        outputName="router-conf.xsd",
        targetNamespace="http://membrane-soa.org/war/1/")
@MCElement(name="servletTransport", configPackage="com.predic8.membrane.core.config.spring")
public class ServletTransport extends Transport {

    boolean removeContextRoot = true;

    public boolean isRemoveContextRoot() {
        return removeContextRoot;
    }

    @MCAttribute
    public void setRemoveContextRoot(boolean removeContextRoot) {
        this.removeContextRoot = removeContextRoot;
    }

    @Override
    public void openPort(String ip, int port, SSLProvider sslProvider) throws IOException {
        // do nothing
    }

    @Override
    public void closeAll() throws IOException {
        // do nothing
    }

    @Override
    public boolean isOpeningPorts() {
        return false;
    }

}
/**
 * 上面是注解，通过注解生产java文件,并输出到对应的目录
 */
